-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist observe: Support tracking observe information over server restarts #1019
Conversation
1b89eef
to
d702c7b
Compare
770ea62
to
ec49b80
Compare
ec49b80
to
9d17d61
Compare
e5b6f2b
to
6f8bf32
Compare
Dear @mrdeep1 The basic mechanism is working well! I only noticed the automatic 4.04 still being sent when the server is shut down gracefully (e.g., Now that I have the basic setup working, I will try to test and review some more. Please bear with me and just leave this PR open :) |
Thanks for doing the testing so far - much appreciated. I did not really think through the 4.04 "issue. As I see it
For 1), 4.04 should be sent out (RFC7641 is a SHOULD for when the resource is deleted) RFC7641 4.2. For 2) the 4.04 should not be sent out. For 3) nothing is expected to be sent out unless 2) failed part way doing the shutdown. To differentiate between 1) and 2), perhaps 1) could continue using SIGTERM, but 2) could use SIGUSR2 (SIGUSR1 is planned for something else). Then the SIGUSR2 handler could call a new function - say - I separately was thinking it made sense to move the current server application's tracking code into libcoap (enabled as a configurable option) but still provide |
6f8bf32
to
f9857e4
Compare
Added in |
f9857e4
to
2816004
Compare
@mkovatsc I have moved most of the application persist logic into the libcoap logic (configurable to enable it, by default enabled) so that only 2 functions need to be called within the application - Application persist callbacks are still available if required (support always available), but there has been some parameter updates (and some function name changes). Any feedback welcome. |
974d125
to
16927de
Compare
16927de
to
32ac413
Compare
Add in optional callbacks for when dynamic resources are setup and deleted. Add in optional callbacks for when observe subscriptions start and stop. Add in optional callbacks for when the observe counter is updated (can be ratelimited) for a resource as well as track when a resource is deleted. Add is support for new functions Main functions with libcoap tracking support are coap_persist_startup() coap_persist_stop() coap-server has -t option to track observe information. UDP sessions supported, as well as OSCORE over UDP. Documentation updated libcoap tracking support (as opposed to application tracking) is configurable.
32ac413
to
6e78c5b
Compare
Add in optional callbacks for when observe subscriptions start and stop.
Add in optional callbacks for when the observe counter is updated (can be ratelimited) for a resource as well as track when a resource is deleted.
Add is support for new functions
coap_persist_observe() for server to add in tracked observe information.
coap_resource_set_observe_num() to update observe counter from tracked information.
coap_observe_track() to define the optional callback functions.
coap-server has -t option to track observe information (most of the code updates).
UDP sessions supported, as well as OSCORE over UDP.
Documentation updated